package com.qujia.station.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.qujia.station.domain.MemberManagement;
import com.qujia.station.domain.dto.MemberManagementDto;
import com.qujia.station.domain.dto.MemberManagementQueryDto;
import com.qujia.station.domain.vo.MemberManagementVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
* @author PC
* @description 针对表【member_management(成员管理表)】的数据库操作Service
* @createDate 2023-08-29 16:35:10
*/
public interface MemberManagementService extends IService<MemberManagement> {

    /**
     * 新增成员
     * @param memberManagementDto
     * @return
     */
    Integer addMember(MemberManagementDto memberManagementDto);

    /**
     * 删除成员
     * @param ids
     * @return
     */
    Integer deleteMemberManagement(String ids);

    /**
     * 修改成员信息
     * @param memberManagementDto
     * @return
     */
    Integer updateMemberManagement(MemberManagementDto memberManagementDto);

    /**
     * 查询成员信息
     * @param memberManagementDto
     * @return
     */
    List<MemberManagementVo> selectMemberManagement(MemberManagementQueryDto memberManagementDto);

    /**
     * 根据成员id 更改团队 或者油企
     * @param management
     */
    void updateBySalesmanId(MemberManagement management);

    /**
     * 获取成员管理的油企id
     * @param id
     * @return
     */
    List<Long> getMemberEnterpriseId(Long id);

    /**
     * 根据成员的用户id 获取成员管理信息
     * @param id
     * @return
     */
    MemberManagementVo  getBySalesmanId(Long id);

    /**
     * 更改成员信息
      * @param leaderId
     * @param teamId
     */
    void updateMemberManagement(@Param("leaderId")Long leaderId, @Param("teamId")Long teamId);

    /**
     * 根据油企id 获取地区
     * @param id
     * @return
     */
    String getDistrictByEnterpriseId(Long id);

    /**
     * 根据用户id获取成员管理信息
     */
    MemberManagement selectBySalesmanId(Long id);

    List<Long> getEnterpriseIdBySalesmanId(List<Long> salesmanIdList);

    String getDistrictByEnterpriseIdAndTeamId(@Param("enterpriseId")Long enterpriseId ,@Param("districtIds")List<Integer> districtIds );
}
